﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EasyCore.Authentications
{
    public class JwtOptions 
    {     
        /// <summary>
        ///JWT配置节点名称 
        /// </summary>
        public const string Name = "JwtSettings";

        /// <summary>
        ///过期时间，缺省为30分钟
        /// </summary>
        public readonly static int DefaultAccessTokenExpiresMinutes = 30; 

        /// <summary>
        /// 刷新令牌，缺省为7天
        /// </summary>
        public readonly static int DefaultRefreshTokenExpiresDays = 7;

        /// <summary>
        /// 密钥
        /// </summary>
        public string SecretKeyStr { get; set; }

        /// <summary>
        /// 发行者
        /// </summary>
        public string Issuer { get; set; }

        /// <summary>
        /// 受众（接收者）
        /// </summary>
        public string Audience { get; set; }

        /// <summary>
        /// 访问令牌的过期时间
        /// </summary>
        public int AccessTokenExpiresMinutes { get; set; } = DefaultAccessTokenExpiresMinutes;

        /// <summary>
        /// 刷新令牌的过期时间
        /// </summary>
        public int RefreshTokenExpiresDays { get; set; } = DefaultRefreshTokenExpiresDays;
    }
}
